package com.cykj.pos.service.impl;

import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.cykj.pos.mapper.AizUnActiveRecordsMapper;
import com.cykj.pos.domain.AizUnActiveRecords;
import com.cykj.pos.service.IAizUnActiveRecordsService;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

/**
 * 未激活列表Service业务层处理
 *
 * @author Zephyr
 * @date 2025-03-20
 */
@Service
public class AizUnActiveRecordsServiceImpl extends ServiceImpl<AizUnActiveRecordsMapper, AizUnActiveRecords> implements IAizUnActiveRecordsService {

    @Resource
    private AizUnActiveRecordsMapper aizUnActiveRecordsMapper;

    @Override
    public List<AizUnActiveRecords> queryList(AizUnActiveRecords aizUnActiveRecords) {
        LambdaQueryWrapper<AizUnActiveRecords> lqw = Wrappers.lambdaQuery();
        if (StringUtils.isNotBlank(aizUnActiveRecords.getMerchName())){
            lqw.like(AizUnActiveRecords::getMerchName ,aizUnActiveRecords.getMerchName());
        }
        if (StringUtils.isNotBlank(aizUnActiveRecords.getMerchantCode())){
            lqw.eq(AizUnActiveRecords::getMerchantCode ,aizUnActiveRecords.getMerchantCode());
        }
        if (StringUtils.isNotBlank(aizUnActiveRecords.getMerchantName())){
            lqw.like(AizUnActiveRecords::getMerchantName ,aizUnActiveRecords.getMerchantName());
        }
        if (StringUtils.isNotBlank(aizUnActiveRecords.getPosSn())){
            lqw.eq(AizUnActiveRecords::getPosSn ,aizUnActiveRecords.getPosSn());
        }
        return this.list(lqw);
    }

    @Override
    public void deleteBySn(String termphyno) {
        aizUnActiveRecordsMapper.deleteBySn(termphyno);
    }
}
